package fy.EAM.operator;

import com.seeyon.v3x.services.flow.bean.FlowExport;
import com.seeyon.v3x.services.form.bean.ValueExport;

import fy.EAM.bean.ComputerHandoverbean;
import fy.EAM.dao.ComputerHandoverdao;
import fy.form.listen.operate.AForm_Save_Operator;
import fy.form.listen.operate.IFormOperator;
import fy.mdm.dao.FiexdAssetReviewDao;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;


public class ComputerHandoveroperator extends AForm_Save_Operator implements IFormOperator{
	private static Log log = LogFactory.getLog(FiexdAssetReviewDao.class);
	private ComputerHandoverbean bean=new ComputerHandoverbean();
	@Override
	public String getFormName() {
		// TODO Auto-generated method stub
		return "计算机验收转移单";
	}

	@Override
	protected void parseOtherField_FirstStep(FlowExport flowExport) {
		// TODO Auto-generated method stub
		
	}

	@Override
	protected void parseValueExport(ValueExport ve) {
		// TODO Auto-generated method stub
		String fieldName = ve.getDisplayName();
		if ("固定资产编号".equals(fieldName)) {
			bean.setAssetNumber(ve.getValue());
		}else if("验收日期".equals(fieldName)) {
			bean.setUsingStartTime(ve.getValue());
		}else if("保修期".equals(fieldName)) {
			bean.setWarrantyPeriod(ve.getValue());
		}else if("规格型号".equals(fieldName)) {
			bean.setAssetModel(ve.getValue());
		}else if("生产厂商销售厂商".equals(fieldName)) {
			bean.setManufacturer(ve.getValue());
		}else if("序列号".equals(fieldName)) {
			bean.setSerialNumber(ve.getValue());
		}else if("服务代码".equals(fieldName)) {
			bean.setServiceId(ve.getValue());
		}else if("详细配置".equals(fieldName)) {
			bean.setAllocation(ve.getValue());
		}else if("显示器SN".equals(fieldName)) {
			bean.setDisplayer(ve.getValue());
		}else if("鼠标SN".equals(fieldName)) {
			bean.setMouse(ve.getValue());
		}else if("键盘SN".equals(fieldName)) {
			bean.setKeyBoard(ve.getValue());
		}else if("电源适配器SN".equals(fieldName)) {
			bean.setPowerAdapt(ve.getValue());
		}else if("MAC地址".equals(fieldName)) {
			bean.setMacAddress(ve.getValue());
		}else if("无线MAC地址".equals(fieldName)) {
			bean.setWifiMac(ve.getValue());
		}else if("使用人".equals(fieldName)) {
			bean.setUserid(ve.getValue());
		}else if("计算机名".equals(fieldName)) {
			bean.setDescription(ve.getValue());
		}else if("合计金额".equals(fieldName)) {
			bean.setAmount(ve.getValue());
		}else if("单据编号".equals(fieldName)) {
			bean.setOABillINum(ve.getValue());
		}else if("公司名称".equals(fieldName)) {
			bean.setCmpCode(ve.getValue());
		}else if("固定资产名称".equals(fieldName)) {
			bean.setAssetName(ve.getValue());
		}
	}
	
	@Override
	protected boolean save() {
		// TODO Auto-generated method stub
		try {
			ComputerHandoverdao dao=new ComputerHandoverdao();
			dao.setComputerHandoverbean(bean);
			return dao.getMaintenance();
		} catch (Exception e) {
			// TODO: handle exception
		}finally {
			//bean.clear();
			bean = null;
		}
		return success;
	}

}
